// import {  } from '../appSdk/index'
export default () => {
    const handleShare = () => {
        const useMap = {
            mini: {
                auth: e => {
                    // const { token: uni_token, source, position } = window.location.search || {};
                    // alert(JSON.stringify(route));
                    // if (!uni_token) return wx.miniProgram.navigateTo({ url: `/pages/user/auth` });
        
                    const params = new URLSearchParams(window.location.search);
                    const [uni_token, source, position] = [params.get('token'), params.get('source'), params.get('position')];
        
                    const values = { UNIAuth: uni_token, source: source || `mini`, position };
                    handleLogin(values);
                }
            },
            app: {
                auth: e => {
                    // const { position } = route.query || {};
                    const params = new URLSearchParams(window.location.search);
                    const [position] = [params.get('position')];
                    const uni_token = window.UNIApp?.getToken();
                    if (!uni_token) return window.UNIApp?.loginApp('logincallback');
        
                    const values = { UNIAuth: uni_token, source: `app`, position }
                    handleLogin(values);
                }
            }
        }
    }
}